package com.thinkinghead.mahjongrecorder;

import android.app.ActionBar;
import android.os.Bundle;
import android.view.ViewGroup;
import android.widget.Button;

import com.thinkinghead.mahjongrecorder.data.connect.ParseObjectConvertor;
import com.thinkinghead.mahjongrecorder.model.Record;

public class GameDetailActivity extends BasicActivity {
	private static final String TAG = "GameDetailActivity";
	private Record record = null;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_game_detail);
		record = getIntent().getParcelableExtra(ParseObjectConvertor.ARG_ITEM_ID);

		// getActionBar().setDisplayHomeAsUpEnabled(true);

		if (savedInstanceState == null) {
			// Bundle args = new Bundle();
			// Record li =
			// getIntent().getParcelableExtra(GameDetailFragment.ARG_ITEM_ID);
			// args.putParcelable(GameDetailFragment.ARG_ITEM_ID, li);
			//
			// GameDetailFragment fragment = new GameDetailFragment();
			// fragment.setArguments(args);
			// getSupportFragmentManager().beginTransaction()
			// .add(R.id.game_detail_container, fragment).commit();
		}

		initView();
		fnTitle();
	}
	
	private void fnTitle() {
		ActionBar actionBar = getActionBar();
		actionBar.setTitle("Record Detail");
	}
	
	private void initView() {
		Button view = new Button(this);
		view.setText(record.getDescription());
		this.setContentView(view, new ViewGroup.LayoutParams(
				ViewGroup.LayoutParams.FILL_PARENT,
				ViewGroup.LayoutParams.FILL_PARENT));
	}

}
